<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.16"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LibTools: H:/project/LibTools/src/socket/internal/IoPortService.cpp 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">LibTools
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.16 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','搜索');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_9ad1227260954e346101f3844f0abb3d.html">socket</a></li><li class="navelem"><a class="el" href="dir_1865c4ce8b99f52bbeabfd52bfdd7cd3.html">internal</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">IoPortService.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_io_port_service_8cpp.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_io_port_service_8h.html">IoPortService.h</a>&quot;</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_timer_info_8h.html">TimerInfo.h</a>&quot;</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &quot;../Timer.h&quot;</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &quot;../../tools/ShareApi.h&quot;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_socket_8h.html">Socket.h</a>&quot;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &quot;../ServiceBase.h&quot;</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160; </div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<a class="code" href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160; </div>
<div class="line"><a name="l00010"></a><span class="lineno"><a class="line" href="class_c_io_port_service.html#a56a36acfa1bc12143465fb5bcd235a5a">   10</a></span>&#160;<a class="code" href="class_c_io_port_service.html#a56a36acfa1bc12143465fb5bcd235a5a">CIoPortService::CIoPortService</a>(<a class="code" href="_sock_data_8h.html#ae8573b45542da05c99e8e2154032d606">IoCompleteFunc</a> func)</div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;{</div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;    <a class="code" href="class_c_io_port_service.html#a407c9ef3c1dba3149bfeee7a3efbbf01">_bWriteLog</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;    <a class="code" href="class_c_io_port_service.html#a523d78403f114ad8b1750bf408f34084">_dwFlagId</a> = <a class="code" href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1a77c97c2869d7aeef57d865d61467fe11">ASYNC_MAX</a>;</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;    <a class="code" href="class_c_io_port_service.html#a4ff69b422ec8562a5dee6b8f7cef5cc0">_bStop</a> = <span class="keyword">true</span>; </div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;    <a class="code" href="class_c_io_port_service.html#aa0c2ca982c8e1aa9f810291b7de79468">_completeFunc</a> = func;</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;    <a class="code" href="class_c_io_port_service.html#a3dc61fe79fcc2d07518bfa701bd2f779">_hWaitServerStop</a> = 0;</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;    <a class="code" href="class_c_io_port_service.html#a922c83ecaab9ff0ce743d6e4f60d243f">_ioCompletes</a>.<a class="code" href="class_shared_ptr.html#a0b0a4c8396bf40f91994f729855c0a5a">Reset</a>(<span class="keyword">new</span> <a class="code" href="class_s_list.html">SList</a>&lt;<a class="code" href="class_shared_ptr.html">SharedPtr&lt;OVERLAPPED_EX&gt;</a> &gt;());</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;    <a class="code" href="class_c_io_port_service.html#ab735af8e6a6f6a5a4491afae96e3c9f7">_ManagerTimeout</a>.<a class="code" href="class_shared_ptr.html#a0b0a4c8396bf40f91994f729855c0a5a">Reset</a>(<span class="keyword">new</span> <a class="code" href="class_timeout_manager.html">TimeoutManager</a>());</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#ifdef WIN32</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;    _waitPost.Reset(<span class="keyword">new</span> <a class="code" href="class_s_list.html">SList</a>&lt;<a class="code" href="class_shared_ptr.html">SharedPtr&lt;OVERLAPPED_EX&gt;</a> &gt;());</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;    <a class="code" href="class_c_io_port_service.html#ae4a7f39422d33ef77ca8ea89b749d613">_timeoutFunc</a> = &amp;<a class="code" href="class_c_timer_base.html#a9bf8e7d97c8eacdbcac56394c19ab510">CTimerBase::TimerComplete</a>;</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;    <a class="code" href="class_c_io_port_service.html#abd6cae804dc7cf92c7c79d9e0549c176">_threadNum</a> = 0;</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;}</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160; </div>
<div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="class_c_io_port_service.html#a250b7ebec0e43bda54858b198e66c867">   26</a></span>&#160;<a class="code" href="_sock_tools_8h.html#ac7875a7f6984241a06892f7041b4d30a">SOCKIDEN</a> <a class="code" href="class_c_io_port_service.html#a250b7ebec0e43bda54858b198e66c867">CIoPortService::GetFlagId</a>()</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;{</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;    <a class="code" href="_sock_tools_8h.html#ac7875a7f6984241a06892f7041b4d30a">SOCKIDEN</a> ret = <a class="code" href="namespace_share_api.html#a3d320458a805a39a1abc145d7aa28fb6">ShareApi::InterlockedIncrement64</a>(&amp;<a class="code" href="class_c_io_port_service.html#a523d78403f114ad8b1750bf408f34084">_dwFlagId</a>);</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    <span class="keywordflow">if</span> (ret &lt; <a class="code" href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1a77c97c2869d7aeef57d865d61467fe11">ASYNC_MAX</a>) </div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;    {</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;        <a class="code" href="namespace_share_api.html#a949e52140a840041bc8d2353327f576a">ShareApi::InterlockedExchange64</a>(&amp;<a class="code" href="class_c_io_port_service.html#a523d78403f114ad8b1750bf408f34084">_dwFlagId</a>, <a class="code" href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1a77c97c2869d7aeef57d865d61467fe11">ASYNC_MAX</a>);</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;        ret = <a class="code" href="namespace_share_api.html#a3d320458a805a39a1abc145d7aa28fb6">ShareApi::InterlockedIncrement64</a>(&amp;<a class="code" href="class_c_io_port_service.html#a523d78403f114ad8b1750bf408f34084">_dwFlagId</a>);</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;    }</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160; </div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    <span class="keywordflow">return</span> ret;</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;}</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160; </div>
<div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="class_c_io_port_service.html#aaba7ef56add86b61b7d3d95ac95b00bc">   38</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_c_io_port_service.html#aaba7ef56add86b61b7d3d95ac95b00bc">CIoPortService::SetIoBuffer</a>(<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html">OVERLAPPED_EX</a>* io, <a class="code" href="tools_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a> status, <span class="keyword">const</span> <span class="keywordtype">char</span>* first, <span class="keyword">const</span> <span class="keywordtype">char</span>* end, <a class="code" href="class_c_sock_addr.html">CSockAddr</a>* addr, <span class="keyword">const</span> <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>&amp; func, <span class="keywordtype">void</span>* invoker)</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;{</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    io-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a3da45429c23fe76e84378d5dcfd24daa">wsaPtr</a>.<a class="code" href="struct___w_s_a_b_u_f.html#a018f049fe75c6f822a1765f16fdcb1f6">buf</a> = const_cast&lt;char*&gt;(first);</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    io-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a3da45429c23fe76e84378d5dcfd24daa">wsaPtr</a>.<a class="code" href="struct___w_s_a_b_u_f.html#a9b7a712e34972f0fab29243f1793d38c">len</a> = (<a class="code" href="tools_8h.html#af632da489ebc3708ec3ab6791ee53fa4">ULONG</a>)(end - first);</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    <span class="comment">// 设置当前的套接字状态</span></div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    io-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a614e5742d57e4905fdf46b8727486b5e">sockStatus</a> = status;</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    <span class="comment">// 设置完成函数</span></div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;    io-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a2696e48028b12aa65b271ec208c5483c">handle</a> = func;</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;    io-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a29eca265ddf9e8858e7360a27004866b">sockError</a>.SetError(CSockError::SUCC);</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    io-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#af6cda33264504094d59752d5725eb8e6">invoker</a> = invoker;</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    io-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#aa4b473bf1be397a9e437a397f907e69d">addrbuf</a> = addr;</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;}</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160; </div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="class_c_io_port_service.html#a31f5b0cd661829a0772d69f2558cf9c7">   51</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_c_io_port_service.html#aaba7ef56add86b61b7d3d95ac95b00bc">CIoPortService::SetIoBuffer</a>(<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html">OVERLAPPED_EX</a>* io, <a class="code" href="tools_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a> status, <span class="keyword">const</span> <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>&amp; func, <span class="keywordtype">void</span>* invoker)</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;{</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    io-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a3da45429c23fe76e84378d5dcfd24daa">wsaPtr</a>.<a class="code" href="struct___w_s_a_b_u_f.html#a018f049fe75c6f822a1765f16fdcb1f6">buf</a> = <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>;</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    io-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a3da45429c23fe76e84378d5dcfd24daa">wsaPtr</a>.<a class="code" href="struct___w_s_a_b_u_f.html#a9b7a712e34972f0fab29243f1793d38c">len</a> = 0;</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    <span class="comment">// 设置当前的套接字状态</span></div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    io-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a614e5742d57e4905fdf46b8727486b5e">sockStatus</a> = status;</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    <span class="comment">// 设置完成函数</span></div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    io-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a2696e48028b12aa65b271ec208c5483c">handle</a> = func;</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    io-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a29eca265ddf9e8858e7360a27004866b">sockError</a>.SetError(CSockError::SUCC);</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    io-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#af6cda33264504094d59752d5725eb8e6">invoker</a> = invoker;</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    <span class="comment">//io-&gt;sockData = sockdata;</span></div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;}</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160; </div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="class_c_io_port_service.html#a6bb17ecf133490bae0d660eeeff35f76">   64</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_c_io_port_service.html#a6bb17ecf133490bae0d660eeeff35f76">CIoPortService::SetSocketBuffer</a>(<a class="code" href="class_c_socket.html">CSocket</a>&amp; sock, <a class="code" href="class_c_basic_service.html">CBasicService</a>* oldService)</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;{</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    <span class="keywordflow">if</span> (sock.<a class="code" href="class_c_socket.html#a8ae50c5de21c05ad5cc2f5fd7a583e35">GetSocketData</a>()-&gt;<a class="code" href="struct_socket_data.html#aa0eb63e369865fb4ac2fde0bd0b98630">_pServerBuf</a>.<a class="code" href="class_shared_ptr.html#a0f15d2d3d2834b0667791f3abfd9e0d7">Get</a>() == <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>){</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;        sock.<a class="code" href="class_c_socket.html#a8ae50c5de21c05ad5cc2f5fd7a583e35">GetSocketData</a>()-&gt;<a class="code" href="struct_socket_data.html#aa0eb63e369865fb4ac2fde0bd0b98630">_pServerBuf</a>.<a class="code" href="class_shared_ptr.html#a0b0a4c8396bf40f91994f729855c0a5a">Reset</a>(<span class="keyword">new</span> <a class="code" href="struct_sock_data_buffer.html">SockDataBuffer</a>);</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    }</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160; </div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <span class="keywordflow">if</span> (oldService == <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>){</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;        sock.<a class="code" href="class_c_socket.html#a8ae50c5de21c05ad5cc2f5fd7a583e35">GetSocketData</a>()-&gt;<a class="code" href="struct_socket_data.html#aa0eb63e369865fb4ac2fde0bd0b98630">_pServerBuf</a>-&gt;<a class="code" href="struct_sock_data_buffer.html#a55010c98dc7337f4c8c12b2d0cf53118">sockid</a> = <a class="code" href="class_c_io_port_service.html#a250b7ebec0e43bda54858b198e66c867">GetFlagId</a>();</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    }</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    <span class="keywordflow">else</span> <span class="keywordflow">if</span>(oldService-&gt;<a class="code" href="class_c_basic_service.html#a222fc33e3f8c202533a635effc639a42">GetIoPortService</a>() != <span class="keyword">this</span>){</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;        sock.<a class="code" href="class_c_socket.html#a8ae50c5de21c05ad5cc2f5fd7a583e35">GetSocketData</a>()-&gt;<a class="code" href="struct_socket_data.html#aa0eb63e369865fb4ac2fde0bd0b98630">_pServerBuf</a>-&gt;<a class="code" href="struct_sock_data_buffer.html#a55010c98dc7337f4c8c12b2d0cf53118">sockid</a> = <a class="code" href="class_c_io_port_service.html#a250b7ebec0e43bda54858b198e66c867">GetFlagId</a>();</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    }</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;}</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160; </div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="class_c_io_port_service.html#a78ca0acac3a2f3ca5890cc9db01a2dfe">   78</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_c_io_port_service.html#a78ca0acac3a2f3ca5890cc9db01a2dfe">CIoPortService::ClearAllDeque</a>()</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;{</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    <span class="comment">//_waitAccepts-&gt;clear();</span></div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    <a class="code" href="class_c_io_port_service.html#a922c83ecaab9ff0ce743d6e4f60d243f">_ioCompletes</a>-&gt;<a class="code" href="class_s_list.html#a776024e5a78510a39e71f1c6ae67e5f3">clear</a>();</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    <a class="code" href="class_c_io_port_service.html#ab735af8e6a6f6a5a4491afae96e3c9f7">_ManagerTimeout</a>-&gt;<a class="code" href="class_timeout_manager.html#afcc839b5afb4301bf4cfb8a4f1c0e7c5">Clear</a>();</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;<span class="preprocessor">#ifdef WIN32</span></div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    _waitPost-&gt;clear();</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;}</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160; </div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;<a class="code" href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclass_s_list_html"><div class="ttname"><a href="class_s_list.html">SList</a></div><div class="ttdoc">单链表 只提供向前访问</div><div class="ttdef"><b>Definition:</b> <a href="_s_list_8h_source.html#l00286">SList.h:286</a></div></div>
<div class="ttc" id="asocket_2internal_2_macro_tools_8h_html_a188154dc119900e88c49eb1509810eb1a77c97c2869d7aeef57d865d61467fe11"><div class="ttname"><a href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1a77c97c2869d7aeef57d865d61467fe11">ASYNC_MAX</a></div><div class="ttdef"><b>Definition:</b> <a href="socket_2internal_2_macro_tools_8h_source.html#l00034">MacroTools.h:34</a></div></div>
<div class="ttc" id="aclass_timeout_manager_html"><div class="ttname"><a href="class_timeout_manager.html">TimeoutManager</a></div><div class="ttdef"><b>Definition:</b> <a href="_timer_info_8h_source.html#l00111">TimerInfo.h:111</a></div></div>
<div class="ttc" id="astruct_o_v_e_r_l_a_p_p_e_d___e_x_html_aa4b473bf1be397a9e437a397f907e69d"><div class="ttname"><a href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#aa4b473bf1be397a9e437a397f907e69d">OVERLAPPED_EX::addrbuf</a></div><div class="ttdeci">CSockAddr * addrbuf</div><div class="ttdoc">地址信息</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00073">SockData.h:73</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html_ab735af8e6a6f6a5a4491afae96e3c9f7"><div class="ttname"><a href="class_c_io_port_service.html#ab735af8e6a6f6a5a4491afae96e3c9f7">CIoPortService::_ManagerTimeout</a></div><div class="ttdeci">SharedPtr&lt; TimeoutManager &gt; _ManagerTimeout</div><div class="ttdef"><b>Definition:</b> <a href="_io_port_service_8h_source.html#l00131">IoPortService.h:131</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html_a3dc61fe79fcc2d07518bfa701bd2f779"><div class="ttname"><a href="class_c_io_port_service.html#a3dc61fe79fcc2d07518bfa701bd2f779">CIoPortService::_hWaitServerStop</a></div><div class="ttdeci">SYNCHANDLE _hWaitServerStop</div><div class="ttdef"><b>Definition:</b> <a href="_io_port_service_8h_source.html#l00129">IoPortService.h:129</a></div></div>
<div class="ttc" id="aclass_shared_ptr_html"><div class="ttname"><a href="class_shared_ptr.html">SharedPtr&lt; OVERLAPPED_EX &gt;</a></div></div>
<div class="ttc" id="astruct_sock_data_buffer_html_a55010c98dc7337f4c8c12b2d0cf53118"><div class="ttname"><a href="struct_sock_data_buffer.html#a55010c98dc7337f4c8c12b2d0cf53118">SockDataBuffer::sockid</a></div><div class="ttdeci">SOCKIDEN sockid</div><div class="ttdoc">SOCKET唯一标识符</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00114">SockData.h:114</a></div></div>
<div class="ttc" id="aclass_shared_ptr_html_a0f15d2d3d2834b0667791f3abfd9e0d7"><div class="ttname"><a href="class_shared_ptr.html#a0f15d2d3d2834b0667791f3abfd9e0d7">SharedPtr::Get</a></div><div class="ttdeci">Ty * Get()</div><div class="ttdef"><b>Definition:</b> <a href="_shared_ptr_8h_source.html#l00202">SharedPtr.h:202</a></div></div>
<div class="ttc" id="astruct_o_v_e_r_l_a_p_p_e_d___e_x_html_a2696e48028b12aa65b271ec208c5483c"><div class="ttname"><a href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a2696e48028b12aa65b271ec208c5483c">OVERLAPPED_EX::handle</a></div><div class="ttdeci">SharedPtr&lt; HandleBase &gt; handle</div><div class="ttdoc">用户完成回调函数</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00068">SockData.h:68</a></div></div>
<div class="ttc" id="aclass_c_socket_html_a8ae50c5de21c05ad5cc2f5fd7a583e35"><div class="ttname"><a href="class_c_socket.html#a8ae50c5de21c05ad5cc2f5fd7a583e35">CSocket::GetSocketData</a></div><div class="ttdeci">virtual SharedPtr&lt; SocketData &gt; &amp; GetSocketData()</div><div class="ttdef"><b>Definition:</b> <a href="_socket_8cpp_source.html#l00087">Socket.cpp:87</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html_a407c9ef3c1dba3149bfeee7a3efbbf01"><div class="ttname"><a href="class_c_io_port_service.html#a407c9ef3c1dba3149bfeee7a3efbbf01">CIoPortService::_bWriteLog</a></div><div class="ttdeci">bool _bWriteLog</div><div class="ttdef"><b>Definition:</b> <a href="_io_port_service_8h_source.html#l00123">IoPortService.h:123</a></div></div>
<div class="ttc" id="aclass_c_sock_addr_html"><div class="ttname"><a href="class_c_sock_addr.html">CSockAddr</a></div><div class="ttdoc">协议地址结构体</div><div class="ttdef"><b>Definition:</b> <a href="_sock_tools_8h_source.html#l00043">SockTools.h:43</a></div></div>
<div class="ttc" id="a_sock_tools_8h_html_ac7875a7f6984241a06892f7041b4d30a"><div class="ttname"><a href="_sock_tools_8h.html#ac7875a7f6984241a06892f7041b4d30a">SOCKIDEN</a></div><div class="ttdeci">DEF_BEG_LIBTOOLS typedef INT64 SOCKIDEN</div><div class="ttdoc">SOCKET唯一标识符ID</div><div class="ttdef"><b>Definition:</b> <a href="_sock_tools_8h_source.html#l00019">SockTools.h:19</a></div></div>
<div class="ttc" id="atools_8h_html_a201ce692c9dca6599e5c12d00167419b"><div class="ttname"><a href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div><div class="ttdeci">#define DEF_BEG_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00036">tools.h:36</a></div></div>
<div class="ttc" id="astruct_sock_data_buffer_html"><div class="ttname"><a href="struct_sock_data_buffer.html">SockDataBuffer</a></div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00110">SockData.h:110</a></div></div>
<div class="ttc" id="astruct_o_v_e_r_l_a_p_p_e_d___e_x_html_af6cda33264504094d59752d5725eb8e6"><div class="ttname"><a href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#af6cda33264504094d59752d5725eb8e6">OVERLAPPED_EX::invoker</a></div><div class="ttdeci">void * invoker</div><div class="ttdoc">用户数据</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00076">SockData.h:76</a></div></div>
<div class="ttc" id="aclass_c_basic_service_html_a222fc33e3f8c202533a635effc639a42"><div class="ttname"><a href="class_c_basic_service.html#a222fc33e3f8c202533a635effc639a42">CBasicService::GetIoPortService</a></div><div class="ttdeci">virtual CIoPortService * GetIoPortService()=0</div><div class="ttdoc">获取底层的设备服务类</div></div>
<div class="ttc" id="aclass_c_io_port_service_html_aa0c2ca982c8e1aa9f810291b7de79468"><div class="ttname"><a href="class_c_io_port_service.html#aa0c2ca982c8e1aa9f810291b7de79468">CIoPortService::_completeFunc</a></div><div class="ttdeci">IoCompleteFunc _completeFunc</div><div class="ttdef"><b>Definition:</b> <a href="_io_port_service_8h_source.html#l00127">IoPortService.h:127</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html_a56a36acfa1bc12143465fb5bcd235a5a"><div class="ttname"><a href="class_c_io_port_service.html#a56a36acfa1bc12143465fb5bcd235a5a">CIoPortService::CIoPortService</a></div><div class="ttdeci">CIoPortService(IoCompleteFunc func)</div><div class="ttdef"><b>Definition:</b> <a href="_io_port_service_8cpp_source.html#l00010">IoPortService.cpp:10</a></div></div>
<div class="ttc" id="aclass_c_socket_html"><div class="ttname"><a href="class_c_socket.html">CSocket</a></div><div class="ttdoc">套接口类</div><div class="ttdef"><b>Definition:</b> <a href="_socket_8h_source.html#l00030">Socket.h:30</a></div></div>
<div class="ttc" id="astruct___w_s_a_b_u_f_html_a9b7a712e34972f0fab29243f1793d38c"><div class="ttname"><a href="struct___w_s_a_b_u_f.html#a9b7a712e34972f0fab29243f1793d38c">_WSABUF::len</a></div><div class="ttdeci">ULONG len</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00021">SockData.h:21</a></div></div>
<div class="ttc" id="astruct_o_v_e_r_l_a_p_p_e_d___e_x_html_a3da45429c23fe76e84378d5dcfd24daa"><div class="ttname"><a href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a3da45429c23fe76e84378d5dcfd24daa">OVERLAPPED_EX::wsaPtr</a></div><div class="ttdeci">WSABUF wsaPtr</div><div class="ttdoc">发送或接受缓存区</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00072">SockData.h:72</a></div></div>
<div class="ttc" id="a_sock_data_8h_html_ae8573b45542da05c99e8e2154032d606"><div class="ttname"><a href="_sock_data_8h.html#ae8573b45542da05c99e8e2154032d606">IoCompleteFunc</a></div><div class="ttdeci">DWORD(* IoCompleteFunc)(OVERLAPPED_EX *oved)</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00017">SockData.h:17</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html_abd6cae804dc7cf92c7c79d9e0549c176"><div class="ttname"><a href="class_c_io_port_service.html#abd6cae804dc7cf92c7c79d9e0549c176">CIoPortService::_threadNum</a></div><div class="ttdeci">INT64 _threadNum</div><div class="ttdef"><b>Definition:</b> <a href="_io_port_service_8h_source.html#l00126">IoPortService.h:126</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html_a523d78403f114ad8b1750bf408f34084"><div class="ttname"><a href="class_c_io_port_service.html#a523d78403f114ad8b1750bf408f34084">CIoPortService::_dwFlagId</a></div><div class="ttdeci">SOCKIDEN _dwFlagId</div><div class="ttdef"><b>Definition:</b> <a href="_io_port_service_8h_source.html#l00125">IoPortService.h:125</a></div></div>
<div class="ttc" id="a_io_port_service_8h_html"><div class="ttname"><a href="_io_port_service_8h.html">IoPortService.h</a></div></div>
<div class="ttc" id="aclass_s_list_html_a776024e5a78510a39e71f1c6ae67e5f3"><div class="ttname"><a href="class_s_list.html#a776024e5a78510a39e71f1c6ae67e5f3">SList::clear</a></div><div class="ttdeci">void clear()</div><div class="ttdoc">清空所有元素</div><div class="ttdef"><b>Definition:</b> <a href="_s_list_8h_source.html#l00491">SList.h:491</a></div></div>
<div class="ttc" id="a_timer_info_8h_html"><div class="ttname"><a href="_timer_info_8h.html">TimerInfo.h</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html_ae4a7f39422d33ef77ca8ea89b749d613"><div class="ttname"><a href="class_c_io_port_service.html#ae4a7f39422d33ef77ca8ea89b749d613">CIoPortService::_timeoutFunc</a></div><div class="ttdeci">lpTimeoutCompleteFunc _timeoutFunc</div><div class="ttdef"><b>Definition:</b> <a href="_io_port_service_8h_source.html#l00128">IoPortService.h:128</a></div></div>
<div class="ttc" id="atools_8h_html_af632da489ebc3708ec3ab6791ee53fa4"><div class="ttname"><a href="tools_8h.html#af632da489ebc3708ec3ab6791ee53fa4">ULONG</a></div><div class="ttdeci">unsigned long ULONG</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00136">tools.h:136</a></div></div>
<div class="ttc" id="atools_8h_html_ac909db71799bb22cb7d636a34cd785e4"><div class="ttname"><a href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div><div class="ttdeci">#define DEF_END_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00038">tools.h:38</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html_aaba7ef56add86b61b7d3d95ac95b00bc"><div class="ttname"><a href="class_c_io_port_service.html#aaba7ef56add86b61b7d3d95ac95b00bc">CIoPortService::SetIoBuffer</a></div><div class="ttdeci">void SetIoBuffer(OVERLAPPED_EX *io, DWORD status, const char *first, const char *end, CSockAddr *addr, const SharedPtr&lt; HandleBase &gt; &amp;func, void *invoker)</div><div class="ttdef"><b>Definition:</b> <a href="_io_port_service_8cpp_source.html#l00038">IoPortService.cpp:38</a></div></div>
<div class="ttc" id="astruct_socket_data_html_aa0eb63e369865fb4ac2fde0bd0b98630"><div class="ttname"><a href="struct_socket_data.html#aa0eb63e369865fb4ac2fde0bd0b98630">SocketData::_pServerBuf</a></div><div class="ttdeci">SharedPtr&lt; SockDataBuffer &gt; _pServerBuf</div><div class="ttdoc">内部使用</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00035">SockData.h:35</a></div></div>
<div class="ttc" id="astruct_o_v_e_r_l_a_p_p_e_d___e_x_html"><div class="ttname"><a href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html">OVERLAPPED_EX</a></div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00063">SockData.h:63</a></div></div>
<div class="ttc" id="aclass_c_timer_base_html_a9bf8e7d97c8eacdbcac56394c19ab510"><div class="ttname"><a href="class_c_timer_base.html#a9bf8e7d97c8eacdbcac56394c19ab510">CTimerBase::TimerComplete</a></div><div class="ttdeci">static DWORD TimerComplete(CSockError ec, void *invoker)</div><div class="ttdoc">定时器处理函数</div><div class="ttdef"><b>Definition:</b> <a href="_timer_8cpp_source.html#l00082">Timer.cpp:82</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html_a4ff69b422ec8562a5dee6b8f7cef5cc0"><div class="ttname"><a href="class_c_io_port_service.html#a4ff69b422ec8562a5dee6b8f7cef5cc0">CIoPortService::_bStop</a></div><div class="ttdeci">bool _bStop</div><div class="ttdef"><b>Definition:</b> <a href="_io_port_service_8h_source.html#l00124">IoPortService.h:124</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html_a78ca0acac3a2f3ca5890cc9db01a2dfe"><div class="ttname"><a href="class_c_io_port_service.html#a78ca0acac3a2f3ca5890cc9db01a2dfe">CIoPortService::ClearAllDeque</a></div><div class="ttdeci">void ClearAllDeque()</div><div class="ttdef"><b>Definition:</b> <a href="_io_port_service_8cpp_source.html#l00078">IoPortService.cpp:78</a></div></div>
<div class="ttc" id="aclass_shared_ptr_html_a0b0a4c8396bf40f91994f729855c0a5a"><div class="ttname"><a href="class_shared_ptr.html#a0b0a4c8396bf40f91994f729855c0a5a">SharedPtr::Reset</a></div><div class="ttdeci">void Reset(Ty *p)</div><div class="ttdef"><b>Definition:</b> <a href="_shared_ptr_8h_source.html#l00175">SharedPtr.h:175</a></div></div>
<div class="ttc" id="anamespace_share_api_html_a3d320458a805a39a1abc145d7aa28fb6"><div class="ttname"><a href="namespace_share_api.html#a3d320458a805a39a1abc145d7aa28fb6">ShareApi::InterlockedIncrement64</a></div><div class="ttdeci">LIBTOOLS INT64 InterlockedIncrement64(INT64 *Addend)</div><div class="ttdef"><b>Definition:</b> <a href="_share_api_8cpp_source.html#l01781">ShareApi.cpp:1781</a></div></div>
<div class="ttc" id="aclass_timeout_manager_html_afcc839b5afb4301bf4cfb8a4f1c0e7c5"><div class="ttname"><a href="class_timeout_manager.html#afcc839b5afb4301bf4cfb8a4f1c0e7c5">TimeoutManager::Clear</a></div><div class="ttdeci">void Clear()</div><div class="ttdoc">清空所有定时器</div><div class="ttdef"><b>Definition:</b> <a href="_timer_info_8h_source.html#l00207">TimerInfo.h:207</a></div></div>
<div class="ttc" id="atools_8h_html_a798af1e30bc65f319c1a246cecf59e39"><div class="ttname"><a href="tools_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a></div><div class="ttdeci">unsigned int DWORD</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00134">tools.h:134</a></div></div>
<div class="ttc" id="anamespace_share_api_html_a949e52140a840041bc8d2353327f576a"><div class="ttname"><a href="namespace_share_api.html#a949e52140a840041bc8d2353327f576a">ShareApi::InterlockedExchange64</a></div><div class="ttdeci">LIBTOOLS INT64 InterlockedExchange64(INT64 *Addend, INT64 value)</div><div class="ttdef"><b>Definition:</b> <a href="_share_api_8cpp_source.html#l01772">ShareApi.cpp:1772</a></div></div>
<div class="ttc" id="atools_8h_html_ab689500aaec0db066e3ac9483d3fe425"><div class="ttname"><a href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a></div><div class="ttdeci">#define NullPtr</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00119">tools.h:119</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html_a250b7ebec0e43bda54858b198e66c867"><div class="ttname"><a href="class_c_io_port_service.html#a250b7ebec0e43bda54858b198e66c867">CIoPortService::GetFlagId</a></div><div class="ttdeci">virtual SOCKIDEN GetFlagId()</div><div class="ttdoc">获取唯一socket标识符</div><div class="ttdef"><b>Definition:</b> <a href="_io_port_service_8cpp_source.html#l00026">IoPortService.cpp:26</a></div></div>
<div class="ttc" id="astruct_o_v_e_r_l_a_p_p_e_d___e_x_html_a614e5742d57e4905fdf46b8727486b5e"><div class="ttname"><a href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a614e5742d57e4905fdf46b8727486b5e">OVERLAPPED_EX::sockStatus</a></div><div class="ttdeci">DWORD sockStatus</div><div class="ttdoc">套接口的状态</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00074">SockData.h:74</a></div></div>
<div class="ttc" id="aclass_c_basic_service_html"><div class="ttname"><a href="class_c_basic_service.html">CBasicService</a></div><div class="ttdoc">服务类 基类</div><div class="ttdef"><b>Definition:</b> <a href="_service_base_8h_source.html#l00015">ServiceBase.h:15</a></div></div>
<div class="ttc" id="astruct_o_v_e_r_l_a_p_p_e_d___e_x_html_a29eca265ddf9e8858e7360a27004866b"><div class="ttname"><a href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a29eca265ddf9e8858e7360a27004866b">OVERLAPPED_EX::sockError</a></div><div class="ttdeci">CSockError sockError</div><div class="ttdoc">错误码</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00075">SockData.h:75</a></div></div>
<div class="ttc" id="astruct___w_s_a_b_u_f_html_a018f049fe75c6f822a1765f16fdcb1f6"><div class="ttname"><a href="struct___w_s_a_b_u_f.html#a018f049fe75c6f822a1765f16fdcb1f6">_WSABUF::buf</a></div><div class="ttdeci">CHAR * buf</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00022">SockData.h:22</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html_a922c83ecaab9ff0ce743d6e4f60d243f"><div class="ttname"><a href="class_c_io_port_service.html#a922c83ecaab9ff0ce743d6e4f60d243f">CIoPortService::_ioCompletes</a></div><div class="ttdeci">SharedPtr&lt; SList&lt; SharedPtr&lt; OVERLAPPED_EX &gt; &gt; &gt; _ioCompletes</div><div class="ttdef"><b>Definition:</b> <a href="_io_port_service_8h_source.html#l00130">IoPortService.h:130</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html_a6bb17ecf133490bae0d660eeeff35f76"><div class="ttname"><a href="class_c_io_port_service.html#a6bb17ecf133490bae0d660eeeff35f76">CIoPortService::SetSocketBuffer</a></div><div class="ttdeci">virtual void SetSocketBuffer(CSocket &amp;sock, CBasicService *oldService)</div><div class="ttdoc">设置socket的tcp服务buffer</div><div class="ttdef"><b>Definition:</b> <a href="_io_port_service_8cpp_source.html#l00064">IoPortService.cpp:64</a></div></div>
<div class="ttc" id="a_socket_8h_html"><div class="ttname"><a href="_socket_8h.html">Socket.h</a></div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.16
</small></address>
</body>
</html>
